package com.powergisol.gis.controller;

import com.powergisol.gis.service.TabRectangularPillarService;
import com.powergisol.gis.util.Result;
import com.powergisol.gis.vo.TabGriderVO;
import com.powergisol.gis.vo.TabRectangularPillarVO;
import com.powergisol.gis.vo.TabStairsVO;
import com.powergisol.gis.vo.TabUserVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.security.Principal;

/**
 * @author : laishihao
 * @date : 2020/11/11
 * description :
 */
@RestController
@RequestMapping("/rectangularPillar")
@Api(description = "矩形柱", value = "矩形柱")
public class TabRectangularPillarController extends BaseController{
    @Autowired
    private TabRectangularPillarService rectangularPillarService;

    @GetMapping("/selectRectangularPillar")
    public Result selectRectangularPillar(String uuid, String hcdm01) {
        return rectangularPillarService.selectRectangularPillar(uuid, hcdm01);
    }

    @PostMapping("/excelImportZHU")
    public Result excelImportZHU(MultipartFile excelFile, TabRectangularPillarVO vo, Principal p) {
        TabUserVo tabUserVo = getUser(p);
        return rectangularPillarService.excelImportZHU(excelFile, vo, tabUserVo);
    }

    @PostMapping("/importBoard")
    public Result importBoard(MultipartFile excelFile, TabRectangularPillarVO vo, Principal p) {
        TabUserVo tabUserVo = getUser(p);
        return rectangularPillarService.importBoard(excelFile, vo, tabUserVo);
    }

    @PostMapping("/excelImportLIANG")
    public Result excelImportLIANG(MultipartFile excelFile, TabGriderVO vo, Principal p) {
        TabUserVo tabUserVo = getUser(p);
        return rectangularPillarService.excelImportLIANG(excelFile, vo,tabUserVo);
    }


    @PostMapping("/excelImportStairs")
    public Result excelImportStairs(MultipartFile excelFile, TabStairsVO vo, Principal p){
        TabUserVo tabUserVo = getUser(p);
        return rectangularPillarService.excelImportStairs(excelFile,vo,tabUserVo);
    }


}
